import React from 'react';
import { Table } from 'antd';

interface TableBoxProps {
  columns: any[];
  data: any;
  pagination: any;
  total: number;
  onChangePage: any;
}

const TableBox: React.FC<TableBoxProps> = ({
  columns,
  data,
  pagination,
  total,
  onChangePage,
}) => {
  return (
    <Table
      rowKey="id"
      columns={columns}
      dataSource={data}
      pagination={{ ...pagination, total: total, showSizeChanger: false }}
      scroll={{ x: 1000 }}
      onChange={onChangePage}
    />
  );
};

export default TableBox;
